/**
 * Copyright (c) 2010-2011 julewa.com.  
 * All rights reserved. 
 * 
 * @author Huang Benhua
 * @date 2011-5-10
 * 
**/
package com.julewa.loading;

import javax.servlet.ServletContext;

import org.apache.struts2.convention.ConventionUnknownHandler;

import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.XWorkException;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;

public class LocalUnkownHandler extends ConventionUnknownHandler{

	 @Inject
	    public LocalUnkownHandler(Configuration configuration, ObjectFactory objectFactory,
	            ServletContext servletContext, 
	            Container container,
	           // ResultMapBuilder resultMapBuilder, ConventionsService conventionsService,
	            @Inject("struts.convention.default.parent.package") String defaultParentPackageName,
	            @Inject("struts.convention.redirect.to.slash") String redirectToSlash,
	            @Inject("struts.convention.action.name.separator") String nameSeparator){
		super(configuration, objectFactory, servletContext, 
				container,
				//resultMapBuilder, conventionsService, 
				defaultParentPackageName, redirectToSlash,
				nameSeparator);
	}
	
	public ActionConfig handleUnknownAction(String namespace, String actionName)
	    throws XWorkException {
		 ActionConfig config = super.handleUnknownAction(namespace, actionName);
		 //
		// if(config == null || config.isAllowedMethod(method)){
		//	 config = super.handleUnknownAction(namespace + "/" + actionName, "index");
		// }
		 
		 return config;
	 }

}
